<template>
<div class="main">
  <div class="cnt_classify">
    <div class="classify_item">
      <a href="buy/keClassifyList.html"> <div class="lep_icon"><img src="../assets/images/lep_icon.png" /> </div></a>
      <div class="lep_info">学习得积分</div>
    </div>
    <div class="classify_item">
      <a href="appshare/appshare.html">
        <div class="item_RT">
          <div class="item_RTl"><span>邀请好友</span><br><span class="de_jf">可获得300积分</span></div>
          <div class="item_RTl"><img src="../assets/images/yao_icon.png"/> </div>
        </div>
      </a>
      <div class="item_RT">
        <div class="item_RTl"><span>学免费课程</span><br><span class="de_jf">拿积分</span></div>
        <div class="item_RTl"><img src="../assets/images/ke_icon.png"/> </div>
      </div>
    </div>

  </div>

  <div class="gameBox">
    <div class="game_tit">交易游戏</div>
    <div class="game_item_box">
      <div class="game_item">
        <div class="game_item_pic"><img src="../assets/images/game_k.png" /> </div>
        <div class="game_item_text">K线练习</div>
      </div>
      <a href="oneduobaoh5/oneindex.html">
        <div class="game_item">
          <div class="game_item_pic"><img src="../assets/images/game_d.png" /> </div>
          <div class="game_item_text">夺宝练习</div>
        </div>
      </a>
      <div class="game_item">
        <div class="game_item_pic"><img src="../assets/images/game_m.png" /> </div>
        <div class="game_item_text">模拟练习</div>
      </div>

    </div>

  </div>

  <!-- 以下为测试代码  {{all_myrest_QueryHome.classifyList[0].totalReward}}-->
  <div class="resultData"></div>
  <div class="products_box">
    <div class="products_tit" >抽奖区</div>
    <div class="products_list clear" id="products_list">
      <!-- 以上为测试代码      http://sctpfw.lep365.com//upload/product/39/16/product_0.jpg-->
      <a href=" shoppingMall/mallInfoCntIndex.html?infocnt="  v-for="item in all_myrest_QueryHome">
        <div class="pro_item">
          <div class="pro_pic"><img v-bind:src="item.image" /></div>
          <div class="pro_info">
            <div class="pro_tit">标题标题</div>
            <div class="pro_jf">积分：<span>200</span>万</div>
          </div>
        </div>
      </a>
    </div>
  </div>
</div>
</template>
<script>
  import stores from './mystore.js'
  import Vue from 'vue';
  import { XButton, XInput,Group, Tab, TabItem } from 'vux'
  import { mapGetters,mapActions } from 'vuex'
  import sha1 from 'js-sha1'

  export default {
      data(){
          return {
              successMsg:"",
              items:[1,2,3,4,5],
              mypayload:{
                  url:'baseapi',
                  actionName:"QueryHome",
                  postData: {
                      //mobile:"18616717008",
                      //password:"112233",
                      //treeView:"true"
                  }
              }
          }
      },

      computed:{
        all_islogoined () {
          return this.$store.getters.all_islogoined
        },
          all_myrest(){
              return this.$store.getters.all_restful
          },
          all_myrest_QueryHome(){
              var dataval=this.$store.getters.all_restful_QueryHome;
              var testData={"myname":"dongguang"}
              if(dataval){
                  console.log(666)
                  return dataval.body.goodsList
              }else{
                  console.log(5555555)
                  /*return {
                      "body":{
                          "goodsList":[
                            {
                              "id": "f9c0cb2cd807459885adb001828fe2b2",
                              "image": "http://sctpfw.lep365.com//upload/product/39/16/product_0.jpg",
                              "name": "Apple iPhone 7 128G 红色特别版",
                              "price": 1200000
                            }
                          ]
                      }
                  };*/
                  return null
              }
              //return dataval;
          },
          all_nots(){
              return this.$store.getters.all_nots
          },
          all_login(){
              return this.$store.getters.all_login
          },
          ...mapGetters([ 'evenOrOdd'
          ])
      },
      created (){
          this.cntReady();
          console.log('hahahahhahahahah'+this.cntReady())
      },

      methods:{
          dosth (){
              this.$store.commit('restful_api',this.mypayload)
          },

          cntReady(){
              console.info(3434343);
              this.$store.commit('restful_api',this.mypayload);
              //alert(2)
           },

          ...mapActions([
              'increment',
              'decrement',
              'incrementIfOdd'
          ]),
      },
      components: { XButton, Group, XInput, Tab, TabItem }

  }

</script>

<style scoped>
  html,body{ width: 100%; background-color: #f2f2f2;}
  div img{ width: 100%; display: block;}
  a{ text-decoration: none; color: #000;}
  .clear:after{ content: ""; display: block;height: 0;visibility: hidden;clear: both;}

  .cnt_classify{ display: box; display: -webkit-box; background-color: #fff;}
  .classify_item:nth-child(1){ width: 35%; border-right: 1px solid #eee;}
  .classify_item:nth-child(2){ -webkit-box-flex: 1;}
  .item_RT{ display: box; display: -webkit-box; padding: 10px 0;}
  .item_RT:nth-child(1){ border-bottom: 1px solid #eee;}
  .item_RTl:nth-child(1){ text-align: center; font-size: 12px; -webkit-box-flex: 1; line-height: 18px;box-sizing: border-box;}
  .item_RTl:nth-child(2){ width: 30%; font-size: 12px; line-height: 18px; box-sizing: border-box; }
  .item_RTl img{ width: 28px; _margin: 0 auto;}
  .lep_icon{ width: 60px; margin: 0 auto; padding-top: 5px;}
  .lep_info{ font-size: 12px; text-align: center;}
  .de_jf{ color: #fc9400;}

  .gameBox{ margin-top: 10px; background-color: #fff;}
  .game_tit{ font-size: 14px; font-weight: bold; padding: 10px; border-bottom: 1px solid #eee;}

  .game_item_box{ display: box; display: -webkit-box; padding: 10px 0;}
  .game_item{ -webkit-box-flex: 1;}
  .game_item_pic{ width: 26px; margin: 0 auto;}
  .game_item_text{ text-align: center; font-size: 12px; margin-top: 5px;}

  .products_box{ background-color: #fff; margin-top: 10px; padding-bottom: 70px; }
  .products_tit{ font-size: 14px; font-weight: bold; padding: 10px; border-bottom: 1px solid #eee;}
  .pro_item{ width: 45.5%; border: 1px solid #f2f2f2; float: left; margin: 10px 0 0 10px; }
  .pro_info{ background-color: #fafafa; padding: 10px;}
  .pro_tit{ font-size: 14px; height: 38px; overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;}
  .pro_jf{ color: #fc9400; font-size: 12px;}

  .mall_footer{ width:100%; position:fixed; bottom:-1px; left:0; background:rgba(255,255,255,0.95); box-shadow:0 6px 16px #000; z-index:2;}
  .mall_footer ul{}
  .mall_footer ul li{ width:25%; height:50px; box-sizing:border-box; float:left; padding-top:5px; list-style: none; }
  .mall_footer ul li img{ margin:0 auto; width:27%;}
</style>
